name = '''
题目：
输入：一个方阵
要求：将该方阵完成转秩, 不可以使用额外的存储空间，请直接“in-place 操作”矩阵元素

延伸阅读：in-place 操作
Do not allocate extra space for another array.
You must do this by modifying the input array in-place with O(1) extra memory.
https://leetcode.com/explore/learn/card/fun-with-arrays/511/in-place-operations/3258/


进阶题目：
注意输入不是方阵，n*m，需要创建一个m*n的矩阵
试试：
mtx = [ [0] * 3 ] * 4
https://leetcode.com/problems/transpose-matrix/


面试题目:

以下哪些排序是 in-place 操作：
冒泡排序
合并排序 merge sort
quick sort

'''
print(name)

def transpose_square_matrix(mtx):
    ?
    return mtx


print('Accept' if transpose_square_matrix([ [1] ]) == [[1]]  else 'Wrong Answer')
print('Accept' if transpose_square_matrix([ [1, 2], [3,4] ]) == [[1,3],[2,4]]  else 'Wrong Answer')
print('Accept' if transpose_square_matrix(
    [
    [1,2,3],
    [4,5,6],
    [7,8,9]
    ]) ==  [
        [1,4,7],
        [2,5,8],
        [3,6,9]] else 'Wrong Answer')


